﻿namespace StockAnalyst2.StockGrid
{
	internal static class AllColumnsOptionsDataSource
	{
		public static AllColumnsOptions Load()
		{
			AllColumnsOptions result = new AllColumnsOptions();

			result.Symbol = ColumnOptionsDataSource.Load("Symbol");
			result.Value = ColumnOptionsDataSource.Load("Value");
			result.OpenDiffPercentage = ColumnOptionsDataSource.Load("OpenDiffPercentage");
			result.PreviousDiffPercentage = ColumnOptionsDataSource.Load("PreviousDiffPercentage");
			result.BidVolume = ColumnOptionsDataSource.Load("BidVolume");
			result.Bid = ColumnOptionsDataSource.Load("Bid");
			result.Ask = ColumnOptionsDataSource.Load("Ask");
			result.AskVolume = ColumnOptionsDataSource.Load("AskVolume");
			result.GapDiffPercentage = ColumnOptionsDataSource.Load("GapDiffPercentage");
			result.BidAskAverage = ColumnOptionsDataSource.Load("BidAskAverage");
			result.Max = ColumnOptionsDataSource.Load("Max");
			result.Min = ColumnOptionsDataSource.Load("Min");
			result.LastVolume = ColumnOptionsDataSource.Load("LastVolume");
			result.TotalVolume = ColumnOptionsDataSource.Load("TotalVolume");
			result.LastOperation = ColumnOptionsDataSource.Load("LastOperation");
			result.MaxOpenDiffPercentage = ColumnOptionsDataSource.Load("MaxOpenDiffPercentage");
			result.MinOpenDiffPercentage = ColumnOptionsDataSource.Load("MinOpenDiffPercentage");
			result.OpenValue = ColumnOptionsDataSource.Load("OpenValue");
			result.PreviousDayValue = ColumnOptionsDataSource.Load("PreviousDayValue");
			result.Status = ColumnOptionsDataSource.Load("Status");
			result.Date = ColumnOptionsDataSource.Load("Date");

			return result;
		}

		public static void Save(AllColumnsOptions columnsOptions)
		{
			ColumnOptionsDataSource.Save(columnsOptions.Symbol);
			ColumnOptionsDataSource.Save(columnsOptions.Value);
			ColumnOptionsDataSource.Save(columnsOptions.OpenDiffPercentage);
			ColumnOptionsDataSource.Save(columnsOptions.PreviousDiffPercentage);
			ColumnOptionsDataSource.Save(columnsOptions.BidVolume);
			ColumnOptionsDataSource.Save(columnsOptions.Bid);
			ColumnOptionsDataSource.Save(columnsOptions.Ask);
			ColumnOptionsDataSource.Save(columnsOptions.AskVolume);
			ColumnOptionsDataSource.Save(columnsOptions.GapDiffPercentage);
			ColumnOptionsDataSource.Save(columnsOptions.BidAskAverage);
			ColumnOptionsDataSource.Save(columnsOptions.Max);
			ColumnOptionsDataSource.Save(columnsOptions.Min);
			ColumnOptionsDataSource.Save(columnsOptions.LastVolume);
			ColumnOptionsDataSource.Save(columnsOptions.TotalVolume);
			ColumnOptionsDataSource.Save(columnsOptions.LastOperation);
			ColumnOptionsDataSource.Save(columnsOptions.MaxOpenDiffPercentage);
			ColumnOptionsDataSource.Save(columnsOptions.MinOpenDiffPercentage);
			ColumnOptionsDataSource.Save(columnsOptions.OpenValue);
			ColumnOptionsDataSource.Save(columnsOptions.PreviousDayValue);
			ColumnOptionsDataSource.Save(columnsOptions.Status);
			ColumnOptionsDataSource.Save(columnsOptions.Date);
		}
	}
}
